﻿namespace NEvoWeb.Modules.NB_Store
{
    using DotNetNuke.Common;
    using DotNetNuke.Entities.Modules;
    using DotNetNuke.Entities.Modules.Actions;
    using DotNetNuke.Framework;
    using DotNetNuke.Security;
    using DotNetNuke.Services.Exceptions;
    using DotNetNuke.Services.Localization;
    using DotNetNuke.Services.Search;
    using DotNetNuke.UI.WebControls;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections;
    using System.Runtime.CompilerServices;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public class ProductList : BaseModule, IActionable, ISearchable, IPortable
    {
        private bool _CasCade;
        private string _categoryList;
        [AccessedThroughProperty("CategoryMenu")]
        private NEvoWeb.Modules.NB_Store.CategoryMenu _CategoryMenu;
        [AccessedThroughProperty("ctlPagingControl")]
        private PagingControl _ctlPagingControl;
        private int _CurrentPage;
        [AccessedThroughProperty("dlProductDetail")]
        private DataList _dlProductDetail;
        [AccessedThroughProperty("dlProductList")]
        private DataList _dlProductList;
        private string _EditCtrlKey;
        [AccessedThroughProperty("lblLineBreak")]
        private Label _lblLineBreak;
        [AccessedThroughProperty("lblMsg")]
        private Label _lblMsg;
        private string _OrderByQuery;
        private bool _OrderDESCQuery;
        private int _PageIndex;
        [AccessedThroughProperty("plhCatMsg")]
        private PlaceHolder _plhCatMsg;
        [AccessedThroughProperty("pnlProductList")]
        private Panel _pnlProductList;
        [AccessedThroughProperty("pnlSPO")]
        private Panel _pnlSPO;
        [AccessedThroughProperty("phProductDetailHeader")]
        private PlaceHolder _phProductDetailHeader;
        [AccessedThroughProperty("phProductListHeader")]
        private PlaceHolder _phProductListHeader;
        [AccessedThroughProperty("phProductModuleHeader")]
        private PlaceHolder _phProductModuleHeader;
        private int _RtnTabID;
        private string _searchQuery;
        private bool _WishList;
        private int CatID;
        private int ProdID;

        public ProductList()
        {
            base.Init += new EventHandler(this.Page_Init);
            this.CatID = -1;
            this.ProdID = -1;
            this._CurrentPage = 1;
            this._PageIndex = 1;
            this._CasCade = false;
            this._categoryList = "";
        }

        private int assignCatDefault()
        {
            if (Versioned.IsNumeric(Conversions.ToString(this.Settings["ddlDefaultCategory"])))
            {
                return Conversions.ToInteger(this.Settings["ddlDefaultCategory"]);
            }
            return -1;
        }

        private void dlProductDetail_ItemCommand(object source, DataListCommandEventArgs e)
        {
            object left = NewLateBinding.LateGet(e.CommandSource, null, "CommandName", new object[0], null, null, null);
            if (Operators.ConditionalCompareObjectEqual(left, "AddToBasket", false))
            {
                DataListItem lItem = e.Item;
                CurrentCart.AddItemToCart(this.PortalId, lItem, Conversions.ToBoolean(this.Settings["chkIncrementCart"]), this.UserInfo, this.Request);
                WishList.RemoveProduct(this.PortalId, e.CommandArgument.ToString());
                this.DoAfterBuyRedirect();
            }
            else if (Operators.ConditionalCompareObjectEqual(left, "DocDownload", false))
            {
                int docID = int.Parse(e.CommandArgument.ToString());
                this.ForceDocDownload(docID);
            }
            else if (Operators.ConditionalCompareObjectEqual(left, "DocPurchased", false))
            {
                int num2 = int.Parse(e.CommandArgument.ToString());
                if (SharedFunctions.DocHasBeenPurchasedByDocID(this.UserId, num2))
                {
                    this.ForceDocDownload(num2);
                }
            }
            else if (Operators.ConditionalCompareObjectEqual(left, "AddToWishList", false))
            {
                DataListItem item = e.Item;
                WishList.AddProduct(this.PortalId, e.CommandArgument.ToString(), this.UserInfo);
                this.DoAfterWishListRedirect();
            }
            else if (Operators.ConditionalCompareObjectEqual(left, "RemoveFromWishList", false))
            {
                DataListItem item3 = e.Item;
                WishList.RemoveProduct(this.PortalId, e.CommandArgument.ToString());
                this.DoAfterWishListRedirect();
            }
        }

        private void dlProductList_ItemCommand(object source, DataListCommandEventArgs e)
        {
            object left = NewLateBinding.LateGet(e.CommandSource, null, "CommandName", new object[0], null, null, null);
            if (Operators.ConditionalCompareObjectEqual(left, "AddToBasket", false))
            {
                DataListItem lItem = e.Item;
                this.lblMsg.Text = "";
                CurrentCart.AddItemToCart(this.PortalId, lItem, Conversions.ToBoolean(this.Settings["chkIncrementCart"]), this.UserInfo, this.Request);
                WishList.RemoveProduct(this.PortalId, e.CommandArgument.ToString());
                this.DoAfterBuyRedirect();
            }
            else if (Operators.ConditionalCompareObjectEqual(left, "DocDownload", false))
            {
                int docID = int.Parse(e.CommandArgument.ToString());
                this.ForceDocDownload(docID);
            }
            else if (Operators.ConditionalCompareObjectEqual(left, "DocPurchased", false))
            {
                int num2 = int.Parse(e.CommandArgument.ToString());
                if (SharedFunctions.DocHasBeenPurchasedByDocID(this.UserId, num2))
                {
                    this.ForceDocDownload(num2);
                }
            }
            else if (Operators.ConditionalCompareObjectEqual(left, "AddToWishList", false))
            {
                SharedFunctions.setUrlCookieInfo(this.PortalId, this.Request);
                WishList.AddProduct(this.PortalId, e.CommandArgument.ToString(), this.UserInfo);
                this.DoAfterWishListRedirect();
            }
            else if (Operators.ConditionalCompareObjectEqual(left, "RemoveFromWishList", false))
            {
                SharedFunctions.setUrlCookieInfo(this.PortalId, this.Request);
                WishList.RemoveProduct(this.PortalId, e.CommandArgument.ToString());
                this.DoAfterWishListRedirect();
            }
            else if (Operators.ConditionalCompareObjectEqual(left, "AddRelatedProduct", false))
            {
                SharedFunctions.setUrlCookieInfo(this.PortalId, this.Request);
                DataListItem item = e.Item;
                string expression = SharedFunctions.getAdminCookieValue(this.PortalId, "ProdID");
                string str2 = e.CommandArgument.ToString();
                if (Versioned.IsNumeric(expression) & Versioned.IsNumeric(str2))
                {
                    RelatedProducts.AddProduct(this.PortalId, Conversions.ToString(Conversions.ToInteger(expression)), Conversions.ToString(Conversions.ToInteger(str2)));
                }
                this.DoAfterRelatedRedirect();
            }
        }

        private void DoAfterBuyRedirect()
        {
            string str2 = "";
            string str = "";
            if (SharedFunctions.GetStoreSettingBoolean(this.PortalId, "orderedititems.flag"))
            {
                string url = SharedFunctions.getAdminCookieValue(this.PortalId, "OrderEditRtnURL");
                if (url != "")
                {
                    this.Response.Redirect(url);
                }
            }
            if (this._OrderDESCQuery)
            {
                str2 = "desc=1";
            }
            if (this._OrderByQuery != "")
            {
                str2 = "orderby=" + this._OrderByQuery;
            }
            if (Conversions.ToBoolean(this.Settings["chkRedirectToCart"]))
            {
                if (Versioned.IsNumeric(Conversions.ToString(this.Settings["lstTabs"])))
                {
                    this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(Conversions.ToInteger(this.Settings["lstTabs"])));
                }
                else if (this._PageIndex > 1)
                {
                    this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this._RtnTabID, "", new string[] { "currentpage=" + this._PageIndex.ToString(), "CatID=" + this.CatID.ToString(), str, str2 }));
                }
                else
                {
                    this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this._RtnTabID, "", new string[] { "CatID=" + this.CatID.ToString(), str, str2 }));
                }
            }
            else if (Conversions.ToBoolean(this.Settings["chkNoRedirect"]))
            {
                this.Response.Redirect(this.Request.RawUrl);
            }
            else if (Conversions.ToBoolean(this.Settings["chkTabDefaultRedirect"]))
            {
                this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this._RtnTabID, "", SharedFunctions.getUrlCookieInfo(this.PortalId, new string[] { "" })));
            }
            else
            {
                this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this._RtnTabID));
            }
        }

        private void DoAfterRelatedRedirect()
        {
            this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this._RtnTabID, "", SharedFunctions.getUrlCookieInfo(this.PortalId, new string[] { "" })));
        }

        private void DoAfterWishListRedirect()
        {
            this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this._RtnTabID, "", SharedFunctions.getUrlCookieInfo(this.PortalId, new string[] { "" })));
        }

        public string ExportModule(int ModuleID)
        {
            string str = string.Empty;
            return str;
        }

        private void ForceDocDownload(int DocID)
        {
            NB_Store_ProductDocInfo productDoc = new ProductController().GetProductDoc(DocID, SharedFunctions.GetCurrentCulture());
            if (productDoc != null)
            {
                if (EventInterface.Instance() != null)
                {
                    EventInterface.Instance().DownloadDocument(this.PortalId, DocID, this.UserInfo);
                }
                string str = this.Request.Headers["User-Agent"];
                if (str.Contains("MSIE 7.0") | str.Contains("MSIE 8.0"))
                {
                    this.Response.AppendHeader("content-disposition", "attachment; filename=\"" + productDoc.FileName + productDoc.FileExt + "\"");
                }
                else
                {
                    this.Response.AppendHeader("content-disposition", "attachment; filename=\"" + HttpUtility.UrlDecode(productDoc.FileName) + productDoc.FileExt + "\"");
                }
                this.Response.ContentType = "application/octet-stream";
                this.Response.TransmitFile(productDoc.DocPath);
                this.Response.Flush();
                this.Response.End();
            }
        }

        public SearchItemInfoCollection GetSearchItems(ModuleInfo ModInfo)
        {
            SearchItemInfoCollection infos = null;
            return infos;
        }

        private int GetTemplProductCatID(int ProdID)
        {
            IEnumerator enumerator = null;
            ProductController controller2 = new ProductController();
            CategoryController controller = new CategoryController();
            NB_Store_CategoriesInfo category = new NB_Store_CategoriesInfo();
            ArrayList categoriesAssigned = controller2.GetCategoriesAssigned(ProdID);
            try
            {
                enumerator = categoriesAssigned.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    NB_Store_ProductCategoryInfo current = (NB_Store_ProductCategoryInfo) enumerator.Current;
                    category = controller.GetCategory(current.CategoryID, SharedFunctions.GetCurrentCulture());
                    if (category.ProductTemplate != "")
                    {
                        return category.CategoryID;
                    }
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
            return 0;
        }

        public void ImportModule(int ModuleID, string Content, string Version, int UserID)
        {
        }

        private void Page_Init(object sender, EventArgs e)
        {
            int tabId;
            string str3;
            
            NB_Store_CategoriesInfo category;
            SettingsController controller = new SettingsController();
            string settingName = "";
            string listItemTemplate = "productlist.template";
            string listAltItemTemplate = "productlist.template";
            bool flag4 = false;
            bool flag5 = false;
            if (Settings.Count < 1)
            {
                DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, "Please configure the module first", DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.RedError);
                return;
            }
            try
            {
                flag4 = Conversions.ToBoolean(Conversions.ToString(this.Settings["chkStaticListView"]));
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                flag4 = false;
                ProjectData.ClearProjectError();
            }
            try
            {
                flag5 = Conversions.ToBoolean(this.Settings["chkStaticTemplates"]);
            }
            catch (Exception exception4)
            {
                ProjectData.SetProjectError(exception4);
                Exception exception2 = exception4;
                flag5 = false;
                ProjectData.ClearProjectError();
            }
            this.ProdID = -1;
            if ((this.Request.QueryString["ProdID"] != null) && Versioned.IsNumeric(this.Request.QueryString["ProdID"]))
            {
                this.ProdID = Conversions.ToInteger(this.Request.QueryString["ProdID"]);
            }
            this._CurrentPage = 1;
            if ((this.Request.QueryString["currentpage"] != null) && Versioned.IsNumeric(this.Request.QueryString["currentpage"]))
            {
                this._CurrentPage = Conversions.ToInteger(this.Request.QueryString["currentpage"]);
            }
            if (Versioned.IsNumeric(Conversions.ToString(this.Settings["ddlTabDefaultRedirect"])))
            {
                this._RtnTabID = Conversions.ToInteger(this.Settings["ddlTabDefaultRedirect"]);
            }
            else
            {
                this._RtnTabID = this.TabId;
            }
            if ((this.Request.QueryString["RtnTab"] != null) && Versioned.IsNumeric(this.Request.QueryString["RtnTab"]))
            {
                this._RtnTabID = Conversions.ToInteger(this.Request.QueryString["RtnTab"]);
            }
            if (Conversions.ToBoolean(this.Settings["chkBrowseCategory"]))
            {
                if (this.Request.QueryString["CatID"] != null)
                {
                    if (Versioned.IsNumeric(this.Request.QueryString["CatID"]))
                    {
                        this.CatID = Conversions.ToInteger(this.Request.QueryString["CatID"]);
                        if (this.CatID == 0)
                        {
                            this.CatID = this.assignCatDefault();
                        }
                    }
                    else
                    {
                        this.CatID = this.assignCatDefault();
                    }
                }
                else
                {
                    this.CatID = this.assignCatDefault();
                    int templProductCatID = this.GetTemplProductCatID(this.ProdID);
                    if ((this.ProdID >= 0) & (templProductCatID > 0))
                    {
                        this.CatID = templProductCatID;
                    }
                }
            }
            else
            {
                this.CatID = this.assignCatDefault();
            }
            if (Versioned.IsNumeric(Conversions.ToString(this.Settings["lstProductTabs"])))
            {
                tabId = Conversions.ToInteger(this.Settings["lstProductTabs"]);
            }
            else
            {
                tabId = this.TabId;
            }
            this._EditCtrlKey = "AdminProduct";
            bool blnHasModuleEditPermissions = PortalSecurity.HasNecessaryPermission(SecurityAccessLevel.Edit, this.PortalSettings, this.ModuleConfiguration);
            if (Conversions.ToString(this.Settings["ddlTemplate"]) != "")
            {
                listItemTemplate = Conversions.ToString(this.Settings["ddlTemplate"]);
            }
            if (Conversions.ToString(this.Settings["ddlAlterTemplate"]) != "")
            {
                listAltItemTemplate = Conversions.ToString(this.Settings["ddlAlterTemplate"]);
            }
            if (flag5)
            {
                goto Label_04D6;
            }
            CategoryController controller2 = new CategoryController();
            if (this.CatID < 1)
            {
                ArrayList categoriesAssigned = new ProductController().GetCategoriesAssigned(this.ProdID);
                if (categoriesAssigned != null)
                {
                    IEnumerator enumerator = null ;
                    try
                    {
                        enumerator = categoriesAssigned.GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            NB_Store_ProductCategoryInfo current = (NB_Store_ProductCategoryInfo) enumerator.Current;
                            if (settingName == "")
                            {
                                category = controller2.GetCategory(current.CategoryID, SharedFunctions.GetCurrentCulture());
                                if ((category.ProductTemplate != "") & !category.Archived)
                                {
                                    settingName = category.ProductTemplate;
                                    goto Label_0436;
                                }
                            }
                        }
                    }
                    finally
                    {
                        if (enumerator is IDisposable)
                        {
                            (enumerator as IDisposable).Dispose();
                        }
                    }
                }
            }
        Label_0436:
            category = controller2.GetCategory(this.CatID, SharedFunctions.GetCurrentCulture());
            if (category != null)
            {
                if (category.Archived & (this.assignCatDefault() != this.CatID))
                {
                    this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL());
                }
                if (category.ProductTemplate != "")
                {
                    settingName = category.ProductTemplate;
                }
                if (category.ListItemTemplate != "")
                {
                    listItemTemplate = category.ListItemTemplate;
                }
                if (category.ListAltItemTemplate != "")
                {
                    listAltItemTemplate = category.ListAltItemTemplate;
                }
            }
        Label_04D6:
            str3 = DotNetNuke.Services.Localization.Localization.GetString("BuyText", this.LocalResourceFile);
            NB_Store_SettingsTextInfo info2 = controller.GetSettingsText(this.PortalId, "buybutton.text", SharedFunctions.GetCurrentCulture());
            if ((info2 != null) && (info2.SettingValue != ""))
            {
                str3 = HttpUtility.HtmlDecode(info2.SettingValue);
            }
            string zeroPriceMsg = "";
            info2 = controller.GetSettingsText(this.PortalId, "zeroprice.text", SharedFunctions.GetCurrentCulture());
            if ((info2 != null) && (info2.SettingValue != ""))
            {
                zeroPriceMsg = info2.SettingValue;
            }
            string soldOutImg = "";
            info2 = controller.GetSettingsText(this.PortalId, "soldoutimg.template", SharedFunctions.GetCurrentCulture());
            if ((info2 != null) && (info2.SettingText != ""))
            {
                soldOutImg = info2.SettingText;
            }
            bool lockStockOnCart = SharedFunctions.GetStoreSettingBoolean(this.PortalId, "lockstockoncart", SharedFunctions.GetCurrentCulture());
            int qtyLimit = 0xf423f;
            NB_Store_SettingsInfo info = controller.GetSetting(this.PortalId, "productqty.limit", SharedFunctions.GetCurrentCulture());
            if ((info != null) && Versioned.IsNumeric(info.SettingValue))
            {
                qtyLimit = Conversions.ToInteger(info.SettingValue);
            }
            bool flag6 = false;
            info = controller.GetSetting(this.PortalId, "usertemplates.flag", SharedFunctions.GetCurrentCulture());
            if (info != null)
            {
                flag6 = Conversions.ToBoolean(info.SettingValue);
            }
            if (flag6 & (this.UserId >= 0))
            {
                if (controller.GetSettingsText(this.PortalId, listItemTemplate + "user", SharedFunctions.GetCurrentCulture()) != null)
                {
                    listItemTemplate = listItemTemplate + "user";
                }
                if (controller.GetSettingsText(this.PortalId, listAltItemTemplate + "user", SharedFunctions.GetCurrentCulture()) != null)
                {
                    listAltItemTemplate = listAltItemTemplate + "user";
                }
            }
            info2 = controller.GetSettingsText(this.PortalId, listItemTemplate, SharedFunctions.GetCurrentCulture());
            if (info2 != null)
            {
                this.dlProductList.ItemTemplate = new ProductTemplate(this.TabId, this.ModuleId, base.StoreInstallPath, Conversions.ToString(this.Settings["txtThumbnailSize"]), this.Server.HtmlDecode(info2.SettingText), blnHasModuleEditPermissions, str3, Conversions.ToString(this.Settings["txtCssBuyButton"]), this._CurrentPage, this.CatID, Conversions.ToString(this.Settings["txtGalleryThumbnailSize"]), this._EditCtrlKey, tabId, this.UserId, this.UserInfo, zeroPriceMsg, soldOutImg, lockStockOnCart, qtyLimit, null);
            }
            info2 = controller.GetSettingsText(this.PortalId, listAltItemTemplate, SharedFunctions.GetCurrentCulture());
            if (info2 != null)
            {
                this.dlProductList.AlternatingItemTemplate = new ProductTemplate(this.TabId, this.ModuleId, base.StoreInstallPath, Conversions.ToString(this.Settings["txtThumbnailSize"]), this.Server.HtmlDecode(info2.SettingText), blnHasModuleEditPermissions, str3, Conversions.ToString(this.Settings["txtCssBuyButton"]), this._CurrentPage, this.CatID, Conversions.ToString(this.Settings["txtGalleryThumbnailSize"]), this._EditCtrlKey, tabId, this.UserId, this.UserInfo, zeroPriceMsg, soldOutImg, lockStockOnCart, qtyLimit, null);
            }
            if (this.ProdID >= 0)
            {
                if ((Conversions.ToString(this.Settings["ddlDetailTemplate"]) != "") & (settingName == ""))
                {
                    settingName = Conversions.ToString(this.Settings["ddlDetailTemplate"]);
                }
                if ((flag6 & (this.UserId >= 0)) && (controller.GetSettingsText(this.PortalId, settingName + "user", SharedFunctions.GetCurrentCulture()) != null))
                {
                    settingName = settingName + "user";
                }
                info2 = controller.GetSettingsText(this.PortalId, settingName, SharedFunctions.GetCurrentCulture());
                if (info2 != null)
                {
                    this.dlProductDetail.ItemTemplate = new ProductTemplate(this.TabId, this.ModuleId, base.StoreInstallPath, Conversions.ToString(this.Settings["txtDetailThumbnailSize"]), this.Server.HtmlDecode(info2.SettingText), blnHasModuleEditPermissions, str3, Conversions.ToString(this.Settings["txtCssBuyButton"]), this._CurrentPage, this.CatID, Conversions.ToString(this.Settings["txtGalleryThumbnailSize"]), this._EditCtrlKey, tabId, this.UserId, this.UserInfo, zeroPriceMsg, soldOutImg, lockStockOnCart, qtyLimit, null);
                }
            }
            SharedFunctions.IncludeScripts(this.PortalId, base.StoreInstallPath, this.Page, "productlistjs.includes ", "productliststartupjs.includes", "productlistcss.includes");
            if (Conversions.ToString(this.Settings["txtSep"]) != "")
            {
                this.dlProductList.SeparatorTemplate = new BaseDisplayTemplate(this.Server.HtmlDecode(Conversions.ToString(this.Settings["txtSep"])));
            }
            if (Conversions.ToString(this.Settings["ddlHeaderText"]) != "")
            {
                SharedFunctions.DisplayMsgText(Conversions.ToString(this.PortalId), this.phProductModuleHeader, Conversions.ToString(this.Settings["ddlHeaderText"]), "");
            }
            if (Conversions.ToString(this.Settings["ddlListHeaderText"]) != "")
            {
                SharedFunctions.DisplayMsgText(Conversions.ToString(this.PortalId), this.phProductListHeader, Conversions.ToString(this.Settings["ddlListHeaderText"]), "");
            }
            if (Conversions.ToString(this.Settings["ddlDetailHeaderText"]) != "")
            {
                SharedFunctions.DisplayMsgText(Conversions.ToString(this.PortalId), this.phProductDetailHeader, Conversions.ToString(this.Settings["ddlDetailHeaderText"]), "");
            }
            try
            {
                this._PageIndex = this._CurrentPage;
                if ((this.Request.QueryString["PageIndex"] != null) && Versioned.IsNumeric(this.Request.QueryString["PageIndex"]))
                {
                    this._PageIndex = Conversions.ToInteger(this.Request.QueryString["PageIndex"]);
                }
                this._searchQuery = "";
                if (this.Request.Params["Search"] != null)
                {
                    this._searchQuery = this.Server.UrlDecode(this.Request.Params["Search"]).ToString();
                }
                this._OrderByQuery = "";
                if (this.Request.Params["orderby"] != null)
                {
                    this._OrderByQuery = this.Request.Params["orderby"].ToString();
                }
                this._OrderDESCQuery = false;
                if ((this.Request.Params["desc"] != null) && (this.Request.Params["desc"] != "0"))
                {
                    this._OrderDESCQuery = true;
                }
                this._WishList = false;
                if (this.Request.Params["wishlist"] != null)
                {
                    this._WishList = true;
                }
                this._CasCade = Conversions.ToBoolean(this.Settings["chkCascadeResults"]);
                if (this.Request.Params["cascade"] != null)
                {
                    this._CasCade = true;
                }
                if (!this.Page.IsPostBack)
                {
                    if (SharedFunctions.GetStoreSettingBoolean(this.PortalId, "Referrertrace.flag"))
                    {
                        CurrentCart.GetCurrentCart(this.PortalId, this.Request);
                    }
                    if (((this.ProdID > 0) & !Conversions.ToBoolean(this.Settings["chkFeatured"])) & !flag4)
                    {
                        this.populateSP(this.ProdID);
                    }
                    else
                    {
                        if (!Conversions.ToBoolean(this.Settings["chkFeatured"]))
                        {
                            SharedFunctions.setUrlCookieInfo(this.PortalId, this.Request);
                        }
                        this.populateList(this.CatID);
                    }
                }
            }
            catch (Exception exception5)
            {
                ProjectData.SetProjectError(exception5);
                Exception exc = exception5;
                DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException((PortalModuleBase) this, exc);
                ProjectData.ClearProjectError();
            }
        }

        private void populateList(int CatID)
        {
            ArrayList categories;
            PagingControl ctlPagingControl;
            ProductController controller2 = new ProductController();
            bool featuredOnly = false;
            bool flag = true;
            int returnLimit = 0;
            CategoryController controller = new CategoryController();
            NB_Store_CategoriesInfo categoryListInfo = null;
            int count = 0;
            bool excludeFeatured = false;
            bool flag3 = false;
            HttpCookie listCookie = SharedFunctions.getStoreCookie(this.PortalId, this.ModuleId.ToString() + "_ProductList");
            this.CategoryMenu.Visible = false;
            this.CategoryMenu._SubMenuOnly = true;
            if (!Versioned.IsNumeric(Conversions.ToString(this.Settings["txtPageSize"])))
            {
                return;
            }
            int defaultReturn = Conversions.ToInteger(Conversions.ToString(this.Settings["txtPageSize"]));
            if (flag)
            {
                defaultReturn = SharedFunctions.getCookieQueryValueInt(this.PortalId, "psize", listCookie, this.Request, defaultReturn);
            }
            if (this.Settings["ddlLayout"] == null)
            {
                this.dlProductList.RepeatLayout = RepeatLayout.Table;
            }
            else if (Versioned.IsNumeric(RuntimeHelpers.GetObjectValue(this.Settings["ddlLayout"])))
            {
                this.dlProductList.RepeatLayout = (RepeatLayout) Conversions.ToInteger(this.Settings["ddlLayout"]);
            }
            else
            {
                this.dlProductList.RepeatLayout = RepeatLayout.Table;
            }
            this.dlProductList.ItemStyle.VerticalAlign = VerticalAlign.Top;
            if (this.Settings["txtTableWidth"] == null)
            {
                this.dlProductList.Width = Unit.Parse("100%");
            }
            else if (Operators.ConditionalCompareObjectNotEqual(this.Settings["txtTableWidth"], "", false))
            {
                this.dlProductList.Width = Unit.Parse(Conversions.ToString(this.Settings["txtTableWidth"]));
            }
            if (Versioned.IsNumeric(Conversions.ToString(this.Settings["txtCellPadding"])))
            {
                this.dlProductList.CellPadding = Conversions.ToInteger(this.Settings["txtCellPadding"]);
            }
            else
            {
                this.dlProductList.CellPadding = 0;
            }
            if (Versioned.IsNumeric(Conversions.ToString(this.Settings["txtCellSpacing"])))
            {
                this.dlProductList.CellSpacing = Conversions.ToInteger(this.Settings["txtCellSpacing"]);
            }
            if (Conversions.ToString(this.Settings["txtItemStyleCssClass"]) != "")
            {
                this.dlProductList.ItemStyle.CssClass = Conversions.ToString(this.Settings["txtItemStyleCssClass"]);
            }
            if (Conversions.ToString(this.Settings["txtAlternatingItemStyleCssClass"]) != "")
            {
                this.dlProductList.AlternatingItemStyle.CssClass = Conversions.ToString(this.Settings["txtAlternatingItemStyleCssClass"]);
            }
            if (Versioned.IsNumeric(Conversions.ToString(this.Settings["ddlItemStyleHorizontalAlign"])))
            {
                this.dlProductList.ItemStyle.HorizontalAlign = (HorizontalAlign) Conversions.ToInteger(this.Settings["ddlItemStyleHorizontalAlign"]);
            }
            if (Conversions.ToString(this.Settings["txtItemStyleHeight"]) != "")
            {
                this.dlProductList.ItemStyle.Height = Unit.Parse(Conversions.ToString(this.Settings["txtItemStyleHeight"]));
            }
            if (Conversions.ToString(this.Settings["txtCssClass"]) != "")
            {
                this.dlProductList.CssClass = Conversions.ToString(this.Settings["txtCssClass"]);
            }
            if (Conversions.ToString(this.Settings["txtColWidth"]) != "")
            {
                this.dlProductList.ItemStyle.Width = Unit.Parse(Conversions.ToString(this.Settings["txtColWidth"]));
            }
            if (Versioned.IsNumeric(Conversions.ToString(this.Settings["txtColumns"])))
            {
                this.dlProductList.RepeatColumns = Conversions.ToInteger(this.Settings["txtColumns"]);
            }
            if (Versioned.IsNumeric(Conversions.ToString(this.Settings["ddlDirection"])))
            {
                this.dlProductList.RepeatDirection = (RepeatDirection) Conversions.ToInteger(this.Settings["ddlDirection"]);
            }
            featuredOnly = Conversions.ToBoolean(this.Settings["chkFeatured"]);
            flag = Conversions.ToBoolean(this.Settings["chkBrowseCategory"]);
            excludeFeatured = Conversions.ToBoolean(this.Settings["chkExcludeFeatured"]);
            flag3 = Conversions.ToBoolean(this.Settings["chkExcludeProduct"]);
            if (Versioned.IsNumeric(Conversions.ToString(this.Settings["txtReturnLimit"])))
            {
                returnLimit = Conversions.ToInteger(this.Settings["txtReturnLimit"]);
            }
            if (this._OrderByQuery == "")
            {
                this._OrderByQuery = Conversions.ToString(this.Settings["ddlDefaultOrder"]);
            }
            if (this.Request.Params["desc"] == null)
            {
                this._OrderDESCQuery = Conversions.ToBoolean(this.Settings["chkDefaultOrderDESC"]);
            }
            if (this.Request.QueryString["catfilter"] != null)
            {
                if (this.Request.QueryString["andmode"] == null)
                {
                    this._categoryList = this.Request.QueryString["catfilter"].ToString();
                }
                else if (this.Request.QueryString["catfilter"].ToString() != "")
                {
                    this._categoryList = "A" + this.Request.QueryString["catfilter"].ToString();
                }
            }
            if (this._categoryList == "A")
            {
                this._categoryList = "";
            }
            if ((this._CasCade & (this._categoryList == "")) & (CatID > 0))
            {
                categories = controller.GetCategories(this.PortalId, SharedFunctions.GetCurrentCulture());
                this._categoryList = this._categoryList + controller.GetSubCategoryList(categories, CatID);
                this._categoryList = this._categoryList + CatID.ToString();
            }
            if (defaultReturn <= 0)
            {
                this._CurrentPage = 1;
                defaultReturn = 0x270f;
            }
            if (featuredOnly)
            {
                if (flag && (CatID > 0))
                {
                    categories = controller2.GetProductList(this.PortalId, CatID, SharedFunctions.GetCurrentCulture(), "", false, featuredOnly, this._OrderByQuery, this._OrderDESCQuery, returnLimit, this._CurrentPage, defaultReturn, false, SharedFunctions.IsDealer(this.PortalId, this.UserInfo, SharedFunctions.GetCurrentCulture()), this._categoryList, excludeFeatured);
                    count = controller2.GetProductListSize(this.PortalId, CatID, SharedFunctions.GetCurrentCulture(), "", false, featuredOnly, false, SharedFunctions.IsDealer(this.PortalId, this.UserInfo, SharedFunctions.GetCurrentCulture()), this._categoryList, excludeFeatured);
                }
                else
                {
                    categories = controller2.GetProductList(this.PortalId, this.assignCatDefault(), SharedFunctions.GetCurrentCulture(), "", false, featuredOnly, this._OrderByQuery, this._OrderDESCQuery, returnLimit, this._CurrentPage, defaultReturn, false, SharedFunctions.IsDealer(this.PortalId, this.UserInfo, SharedFunctions.GetCurrentCulture()), this._categoryList, excludeFeatured);
                    count = controller2.GetProductListSize(this.PortalId, this.assignCatDefault(), SharedFunctions.GetCurrentCulture(), "", false, featuredOnly, false, SharedFunctions.IsDealer(this.PortalId, this.UserInfo, SharedFunctions.GetCurrentCulture()), this._categoryList, excludeFeatured);
                }
            }
            else if (this._WishList)
            {
                categories = WishList.GetList(this.PortalId);
                count = categories.Count;
            }
            else if (this._CurrentPage < 0x7d0)
            {
                categories = controller2.GetProductList(this.PortalId, CatID, SharedFunctions.GetCurrentCulture(), this._searchQuery, false, featuredOnly, this._OrderByQuery, this._OrderDESCQuery, returnLimit, this._CurrentPage, defaultReturn, SharedFunctions.GetStoreSettingBoolean(this.PortalId, "searchdescription.flag", SharedFunctions.GetCurrentCulture()), SharedFunctions.IsDealer(this.PortalId, this.UserInfo, SharedFunctions.GetCurrentCulture()), this._categoryList, excludeFeatured);
                count = controller2.GetProductListSize(this.PortalId, CatID, SharedFunctions.GetCurrentCulture(), this._searchQuery, false, featuredOnly, SharedFunctions.GetStoreSettingBoolean(this.PortalId, "searchdescription.flag", SharedFunctions.GetCurrentCulture()), SharedFunctions.IsDealer(this.PortalId, this.UserInfo, SharedFunctions.GetCurrentCulture()), this._categoryList, excludeFeatured);
                if ((returnLimit > 0) && (count > returnLimit))
                {
                    count = returnLimit;
                }
            }
            else
            {
                categories = new ArrayList();
                count = 0;
            }
            if ((!featuredOnly & Conversions.ToBoolean(this.Settings["chkSkipList"])) && ((categories.Count == 1) & (CatID > -1)))
            {
                ProductListInfo objPInfo = (ProductListInfo) categories[0];
                this.Response.Redirect(SharedFunctions.GetProductUrl(this.PortalId, this.TabId, objPInfo, CatID, false));
            }
            if (flag3)
            {
                if (this.ProdID >= 0)
                {
                    IEnumerator enumerator = null;
                    try
                    {
                        enumerator = categories.GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            ProductListInfo current = (ProductListInfo) enumerator.Current;
                            if (current.ProductID == this.ProdID)
                            {
                                categories.Remove(current);
                                goto Label_097F;
                            }
                        }
                    }
                    finally
                    {
                        if (enumerator is IDisposable)
                        {
                            (enumerator as IDisposable).Dispose();
                        }
                    }
                }
                else if (categories.Count > 1)
                {
                    categories.RemoveAt(0);
                }
            }
        Label_097F:
            this.dlProductList.DataSource = categories;
            this.dlProductList.DataBind();
            if ((count <= defaultReturn) | (defaultReturn == -1))
            {
                this.ctlPagingControl.Visible = false;
                this.lblLineBreak.Visible = false;
            }
            this.ctlPagingControl.TotalRecords = count;
            this.ctlPagingControl.PageSize = defaultReturn;
            this.ctlPagingControl.CurrentPage = this._CurrentPage;
            this.ctlPagingControl.TabID = this.TabId;
            this.ctlPagingControl.BorderWidth = 0;
            if (this._searchQuery != "")
            {
                this.ctlPagingControl.QuerystringParams = "Search=" + this.Server.UrlEncode(this._searchQuery);
            }
            if (this._categoryList != "")
            {
                if (this.ctlPagingControl.QuerystringParams != "")
                {
                    ctlPagingControl = this.ctlPagingControl;
                    ctlPagingControl.QuerystringParams = ctlPagingControl.QuerystringParams + "&";
                }
                ctlPagingControl = this.ctlPagingControl;
                ctlPagingControl.QuerystringParams = ctlPagingControl.QuerystringParams + "catfilter=" + this._categoryList;
            }
            if (this._OrderByQuery != "")
            {
                if (this.ctlPagingControl.QuerystringParams != "")
                {
                    ctlPagingControl = this.ctlPagingControl;
                    ctlPagingControl.QuerystringParams = ctlPagingControl.QuerystringParams + "&";
                }
                ctlPagingControl = this.ctlPagingControl;
                ctlPagingControl.QuerystringParams = ctlPagingControl.QuerystringParams + "orderby=" + this._OrderByQuery;
            }
            if (this._OrderDESCQuery)
            {
                ctlPagingControl = this.ctlPagingControl;
                ctlPagingControl.QuerystringParams = ctlPagingControl.QuerystringParams + "&desc=1";
            }
            if (this._WishList)
            {
                if (this.ctlPagingControl.QuerystringParams != "")
                {
                    ctlPagingControl = this.ctlPagingControl;
                    ctlPagingControl.QuerystringParams = ctlPagingControl.QuerystringParams + "&";
                }
                ctlPagingControl = this.ctlPagingControl;
                ctlPagingControl.QuerystringParams = ctlPagingControl.QuerystringParams + "wishlist=1";
            }
            if (this.Request.QueryString["CatID"] != null)
            {
                if (this.ctlPagingControl.QuerystringParams != "")
                {
                    ctlPagingControl = this.ctlPagingControl;
                    ctlPagingControl.QuerystringParams = ctlPagingControl.QuerystringParams + "&";
                }
                ctlPagingControl = this.ctlPagingControl;
                ctlPagingControl.QuerystringParams = ctlPagingControl.QuerystringParams + "CatID=" + Conversions.ToString(CatID);
            }
            if (((this._searchQuery != "") | this._WishList) & (categories.Count == 0))
            {
                if (this._WishList)
                {
                    SharedFunctions.DisplayMsgText(Conversions.ToString(this.PortalId), this.plhCatMsg, "nowishlist.template", "No WishList Found");
                }
                else
                {
                    SharedFunctions.DisplayMsgText(Conversions.ToString(this.PortalId), this.plhCatMsg, "nosearchresult.template", "No Search Results Found");
                }
            }
            else if ((this._searchQuery == "") && (((categories.Count == 0) & (Conversions.ToDouble(Conversions.ToString(this.Settings["rblCategoryMessage"])) == 3.0)) | (Conversions.ToDouble(Conversions.ToString(this.Settings["rblCategoryMessage"])) == 2.0)))
            {
                categoryListInfo = controller.GetCategory(CatID, SharedFunctions.GetCurrentCulture());
                if (categoryListInfo != null)
                {
                    if (categories.Count == 0)
                    {
                        this.ctlPagingControl.Visible = false;
                    }
                    if (EventInterface.Instance() != null)
                    {
                        string str = EventInterface.Instance().getCategoryMessage(this.PortalId, CatID, this.UserInfo);
                        if (str != "")
                        {
                            categoryListInfo.Message = str;
                        }
                    }
                    if (categoryListInfo.Message != "")
                    {
                        categoryListInfo.Message = Strings.Replace(categoryListInfo.Message, "[TAG:CATIMAGEURL]", categoryListInfo.ImageURL, 1, -1, CompareMethod.Binary);
                    }
                    this.plhCatMsg.Controls.Add(new LiteralControl(this.Server.HtmlDecode(categoryListInfo.Message)));
                    this.CategoryMenu.Visible = true;
                    this.CategoryMenu._chkHideSubMenu = !Conversions.ToBoolean(this.Settings["chkShowSubMenu"]);
                    this.CategoryMenu._txtColumns = Conversions.ToString(this.Settings["txtSubMenuCols"]);
                    this.CategoryMenu._txtSubLeftHtml = Conversions.ToString(this.Settings["txtSubLeftHtml"]);
                    this.CategoryMenu._txtSubNameTemplate = Conversions.ToString(this.Settings["txtSubNameTemplate"]);
                    this.CategoryMenu._txtSubRightHtml = Conversions.ToString(this.Settings["txtSubRightHtml"]);
                    this.CategoryMenu._txtSubHeadHtml = Conversions.ToString(this.Settings["txtSubHeadHtml"]);
                    this.CategoryMenu._txtSubSelectCSS = Conversions.ToString(this.Settings["txtSubSelectCSS"]);
                    this.CategoryMenu._txtCSS = Conversions.ToString(this.Settings["txtCSS"]);
                    this.CategoryMenu._txtSubMenuSep = Conversions.ToString(this.Settings["txtSubMenuSep"]);
                    this.CategoryMenu._txtThumbnailSize = Conversions.ToString(this.Settings["txtSubThumbnailSize"]);
                    this.CategoryMenu._ddlDefaultCategory = CatID;
                    this.CategoryMenu._TabId = this.TabId;
                }
            }
            if (this.Settings.ContainsKey("lstModuleTitle") && ((this.Settings["lstModuleTitle"].ToString() == "2") | (this.Settings["lstModuleTitle"].ToString() == "3")))
            {
                if (this._searchQuery != "")
                {
                    this.ModuleConfiguration.ModuleTitle = DotNetNuke.Services.Localization.Localization.GetString("SearchResults", this.LocalResourceFile);
                }
                else
                {
                    if (categoryListInfo == null)
                    {
                        categoryListInfo = controller.GetCategory(CatID, SharedFunctions.GetCurrentCulture());
                    }
                    if (categoryListInfo != null)
                    {
                        this.ModuleConfiguration.ModuleTitle = categoryListInfo.CategoryName;
                    }
                    else
                    {
                        this.ModuleConfiguration.ModuleTitle = DotNetNuke.Services.Localization.Localization.GetString("ModuleTitleAll", this.LocalResourceFile);
                    }
                }
            }
            if (CatID > 0)
            {
                if (categoryListInfo == null)
                {
                    categoryListInfo = controller.GetCategory(CatID, SharedFunctions.GetCurrentCulture());
                }
                if (categoryListInfo != null)
                {
                    if (Conversions.ToBoolean(this.Settings["chkBrowseCategory"]))
                    {
                        this.BasePage.Title = SharedFunctions.CategoryPageName(categoryListInfo, this.PortalSettings.PortalName, this.Page.Title);
                    }
                    if (categoryListInfo.MetaKeywords != "")
                    {
                        this.BasePage.KeyWords = categoryListInfo.MetaKeywords;
                    }
                    if (categoryListInfo.MetaDescription != "")
                    {
                        this.BasePage.Description = categoryListInfo.MetaDescription;
                    }
                    else
                    {
                        this.BasePage.Description = categoryListInfo.CategoryDesc;
                    }
                    if (this.PortalSettings.HomeTabId == this.TabId)
                    {
                        SharedFunctions.IncludeCanonicalLink(this.Page, DotNetNuke.Common.Globals.AddHTTP(this.PortalSettings.PortalAlias.HTTPAlias));
                    }
                    else if (flag)
                    {
                        if (categoryListInfo.SEOName != "")
                        {
                            SharedFunctions.IncludeCanonicalLink(this.Page, SharedFunctions.GetProductListUrlByCatID(this.PortalId, this.TabId, CatID, categoryListInfo.SEOName, SharedFunctions.GetCurrentCulture()));
                        }
                        else
                        {
                            SharedFunctions.IncludeCanonicalLink(this.Page, SharedFunctions.GetProductListUrlByCatID(this.PortalId, this.TabId, CatID, categoryListInfo.CategoryName, SharedFunctions.GetCurrentCulture()));
                        }
                    }
                }
            }
            else if (this.PortalSettings.HomeTabId == this.TabId)
            {
                SharedFunctions.IncludeCanonicalLink(this.Page, DotNetNuke.Common.Globals.AddHTTP(this.PortalSettings.PortalAlias.HTTPAlias));
            }
            this.pnlSPO.Visible = false;
        }

        private void populateSP(int ProdID)
        {
            ProductController controller2 = new ProductController();
            CategoryController controller = new CategoryController();
            ArrayList productInArray = controller2.GetProductInArray(ProdID, SharedFunctions.GetCurrentCulture());
            if (productInArray.Count == 1)
            {
                NB_Store_CategoriesInfo category;
                ProductListInfo productListInfo = (ProductListInfo) productInArray[0];
                if (productListInfo.Archived)
                {
                    this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL());
                }
                if (this.CatID == -1)
                {
                    category = controller.GetCategory(productListInfo.TaxCategoryID, SharedFunctions.GetCurrentCulture());
                }
                else
                {
                    category = controller.GetCategory(this.CatID, SharedFunctions.GetCurrentCulture());
                }
                if (category == null)
                {
                    this.BasePage.Title = SharedFunctions.ProductPageName(productListInfo, "", this.PortalSettings.PortalName);
                }
                else
                {
                    this.BasePage.Title = SharedFunctions.ProductPageName(productListInfo, category.CategoryName, this.PortalSettings.PortalName);
                }
                if (productListInfo.TagWords != "")
                {
                    this.BasePage.KeyWords = productListInfo.SEOName + "," + productListInfo.TagWords;
                }
                if (productListInfo.Summary != "")
                {
                    this.BasePage.Description = productListInfo.SEOName + " " + productListInfo.Summary;
                }
                if (this.Settings.ContainsKey("lstModuleTitle"))
                {
                    if ((this.Settings["lstModuleTitle"].ToString() == "1") | (this.Settings["lstModuleTitle"].ToString() == "3"))
                    {
                        this.ModuleConfiguration.ModuleTitle = productListInfo.ProductName;
                    }
                    if (this.Settings["lstModuleTitle"].ToString() == "2")
                    {
                        this.ModuleConfiguration.ModuleTitle = "";
                    }
                }
                if (this.PortalSettings.HomeTabId == this.TabId)
                {
                    SharedFunctions.IncludeCanonicalLink(this.Page, DotNetNuke.Common.Globals.AddHTTP(this.PortalSettings.PortalAlias.HTTPAlias));
                }
                else
                {
                    SharedFunctions.IncludeCanonicalLink(this.Page, SharedFunctions.GetProductUrl(this.PortalId, this.TabId, productListInfo, this.CatID, true));
                }
            }
            this.dlProductDetail.Width = Unit.Parse("100%");
            this.dlProductDetail.CellPadding = 0;
            this.dlProductDetail.CellSpacing = 0;
            this.dlProductDetail.DataSource = productInArray;
            this.dlProductDetail.DataBind();
            if (SharedFunctions.GetAvailableModelList(this.PortalId, ProdID, SharedFunctions.GetCurrentCulture(), SharedFunctions.IsDealer(this.PortalId, this.UserInfo, SharedFunctions.GetCurrentCulture())).Count == 0)
            {
                string str = SharedFunctions.GetStoreSettingText(this.PortalId, "outofstock.text", SharedFunctions.GetCurrentCulture());
                if (str == "")
                {
                    str = DotNetNuke.Services.Localization.Localization.GetString("OutOfStock", this.LocalResourceFile);
                }
                this.lblMsg.Text = str;
            }
            else
            {
                this.lblMsg.Text = "";
            }
            if (EventInterface.Instance() != null)
            {
                EventInterface.Instance().DisplayProduct(this.PortalId, ProdID, this.UserInfo);
            }
            this.pnlProductList.Visible = false;
        }

        public CDefault BasePage
        {
            get
            {
                return (CDefault) this.Page;
            }
        }

        protected virtual NEvoWeb.Modules.NB_Store.CategoryMenu CategoryMenu
        {
            get
            {
                return this._CategoryMenu;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._CategoryMenu = value;
            }
        }

        protected virtual PagingControl ctlPagingControl
        {
            get
            {
                return this._ctlPagingControl;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._ctlPagingControl = value;
            }
        }

        protected virtual DataList dlProductDetail
        {
            get
            {
                return this._dlProductDetail;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                DataListCommandEventHandler handler = new DataListCommandEventHandler(this.dlProductDetail_ItemCommand);
                if (this._dlProductDetail != null)
                {
                    this._dlProductDetail.ItemCommand -= handler;
                }
                this._dlProductDetail = value;
                if (this._dlProductDetail != null)
                {
                    this._dlProductDetail.ItemCommand += handler;
                }
            }
        }

        protected virtual DataList dlProductList
        {
            get
            {
                return this._dlProductList;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                DataListCommandEventHandler handler = new DataListCommandEventHandler(this.dlProductList_ItemCommand);
                if (this._dlProductList != null)
                {
                    this._dlProductList.ItemCommand -= handler;
                }
                this._dlProductList = value;
                if (this._dlProductList != null)
                {
                    this._dlProductList.ItemCommand += handler;
                }
            }
        }

        

        protected virtual Label lblLineBreak
        {
            get
            {
                return this._lblLineBreak;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._lblLineBreak = value;
            }
        }

        protected virtual Label lblMsg
        {
            get
            {
                return this._lblMsg;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._lblMsg = value;
            }
        }

        public ModuleActionCollection ModuleActions
        {
            get
            {
                ModuleActionCollection actions = new ModuleActionCollection();
                actions.Add(this.GetNextActionID(), DotNetNuke.Services.Localization.Localization.GetString("AddProduct.Action", this.LocalResourceFile), "AddContent.Action", "", "", this.EditUrl("ProdId", "0", this._EditCtrlKey, new string[] { "RtnTab=" + this.TabId.ToString(), "PageIndex=" + this._PageIndex.ToString(), "CatID=" + this.CatID.ToString(), "SkinSrc=" + DotNetNuke.Common.Globals.QueryStringEncode(DotNetNuke.Common.Globals.ResolveUrl("~/DesktopModules/NB_Store/Skins/Dark/Edit")) }), false, SecurityAccessLevel.Edit, true, false);
                actions.Add(this.GetNextActionID(), DotNetNuke.Services.Localization.Localization.GetString("Options.Action", this.LocalResourceFile), "Options", "", "", this.EditUrl("Options"), false, SecurityAccessLevel.Edit, true, false);
                return actions;
            }
        }

        protected virtual PlaceHolder plhCatMsg
        {
            get
            {
                return this._plhCatMsg;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._plhCatMsg = value;
            }
        }

        protected virtual Panel pnlProductList
        {
            get
            {
                return this._pnlProductList;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._pnlProductList = value;
            }
        }

        protected virtual Panel pnlSPO
        {
            get
            {
                return this._pnlSPO;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._pnlSPO = value;
            }
        }

        protected virtual PlaceHolder phProductDetailHeader
        {
            get
            {
                return this._phProductDetailHeader;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._phProductDetailHeader = value;
            }
        }

        protected virtual PlaceHolder phProductListHeader
        {
            get
            {
                return this._phProductListHeader;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._phProductListHeader = value;
            }
        }

        protected virtual PlaceHolder phProductModuleHeader
        {
            get
            {
                return this._phProductModuleHeader;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._phProductModuleHeader = value;
            }
        }
    }
}

